import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor";
import _isString from "lodash/isString";
import _isEmpty from "lodash/isEmpty";

var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2;

/**
 * passwordPolicy - 安全策略
 * @date: 2018-11-6

 */
import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { Button, Col, Collapse, Form, Icon, Input, InputNumber, Row, Spin, Switch, Tooltip } from 'antd';
import { Bind } from 'lodash-decorators';
import classnames from 'classnames';
import { PASSWORD } from 'utils/regExp';
import { Content, Header } from 'components/Page';
import { Button as ButtonPermission } from 'components/Permission';
import { DETAIL_DEFAULT_CLASSNAME, EDIT_FORM_ITEM_LAYOUT, EDIT_FORM_ROW_LAYOUT, FORM_COL_3_LAYOUT } from 'utils/constants';
import intl from 'utils/intl';
import formatterCollections from 'utils/intl/formatterCollections';
import notification from 'utils/notification';
import { getCurrentOrganizationId } from 'utils/utils';
var FormItem = Form.Item;
var Panel = Collapse.Panel;
var PasswordPolicy = (_dec = connect(function (_ref) {
  var passwordPolicy = _ref.passwordPolicy,
      loading = _ref.loading;
  return {
    passwordPolicy: passwordPolicy,
    fetchTableListLoading: loading.effects['passwordPolicy/fetchPasswordPolicyList'],
    saving: loading.effects['passwordPolicy/updatePasswordPolicy'],
    organizationId: getCurrentOrganizationId()
  };
}), _dec2 = Form.create({
  fieldNameProp: null
}), _dec3 = formatterCollections({
  code: ['ciam.passwordPolicy']
}), _dec4 = Bind(), _dec5 = Bind(), _dec6 = Bind(), _dec7 = Bind(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = /*#__PURE__*/function (_PureComponent) {
  _inherits(PasswordPolicy, _PureComponent);

  var _super = _createSuper(PasswordPolicy);

  function PasswordPolicy(props) {
    var _this;

    _classCallCheck(this, PasswordPolicy);

    _this = _super.call(this, props);
    _this.state = {
      collapseKeys: ['passwordPolicy', 'loginPolicy']
    };
    return _this;
  }

  _createClass(PasswordPolicy, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      this.fetchPasswordPolicyList();
    }
    /**
     * onCollapseChange - 折叠面板onChange
     * @param {Array<string>} collapseKeys - Panels key
     */

  }, {
    key: "onCollapseChange",
    value: function onCollapseChange(collapseKeys) {
      this.setState({
        collapseKeys: collapseKeys
      });
    }
    /**
     * 获取表单数据
     */

  }, {
    key: "fetchPasswordPolicyList",
    value: function fetchPasswordPolicyList() {
      var _this$props = this.props,
          dispatch = _this$props.dispatch,
          organizationId = _this$props.organizationId,
          form = _this$props.form;
      form.resetFields();
      dispatch({
        type: 'passwordPolicy/fetchPasswordPolicyList',
        payload: organizationId
      });
    }
    /**
     * 更新密码策略
     */

  }, {
    key: "handleSave",
    value: function handleSave() {
      var _this2 = this;

      var _this$props2 = this.props,
          dispatch = _this$props2.dispatch,
          form = _this$props2.form,
          _this$props2$password = _this$props2.passwordPolicy.passwordPolicyList,
          passwordPolicyList = _this$props2$password === void 0 ? {} : _this$props2$password;
      form.validateFields(function (err, values) {
        if (_isEmpty(err)) {
          dispatch({
            type: 'passwordPolicy/updatePasswordPolicy',
            payload: _objectSpread(_objectSpread({}, passwordPolicyList), values)
          }).then(function (res) {
            if (res) {
              // dispatch({
              //   type: 'passwordPolicy/updateState',
              //   payload: { passwordPolicyList: res },
              // });
              _this2.fetchPasswordPolicyList();

              notification.success();
            }
          });
        }
      });
    }
    /**
     * 密码到期天数input框的自定义校验条件
     * @param {object} rules
     * @param {number} value - 设置密码到期提醒的天数
     * @param {function} callback
     * @returns
     * @memberof PasswordPolicy
     */

  }, {
    key: "expireRemindCheck",
    value: function expireRemindCheck(rules, value, callback) {
      var getFieldValue = this.props.form.getFieldValue;
      var passwordUpdateRate = getFieldValue('passwordUpdateRate') || 0;

      if (value > passwordUpdateRate) {
        return false;
      }

      callback();
    }
    /**
     * 密码安全策略表单
     */

  }, {
    key: "renderPasswordForm",
    value: function renderPasswordForm() {
      var _this$props3 = this.props,
          _this$props3$form = _this$props3.form,
          getFieldDecorator = _this$props3$form.getFieldDecorator,
          getFieldValue = _this$props3$form.getFieldValue,
          _this$props3$password = _this$props3.passwordPolicy.passwordPolicyList,
          passwordPolicyList = _this$props3$password === void 0 ? {} : _this$props3$password;
      return /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(Row, Object.assign({}, EDIT_FORM_ROW_LAYOUT, {
        className: "writable-row"
      }), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.originalPassword').d('新用户默认密码')
      }), getFieldDecorator('originalPassword', {
        rules: [{
          required: true,
          message: intl.get('cpaas.common.validation.notNull', {
            name: intl.get('ciam.subAccount.model.user.password').d('密码')
          })
        }, {
          pattern: PASSWORD,
          message: intl.get('cpaas.common.validation.password').d('至少包含数字/字母/字符2种组合,长度至少为6个字符')
        }],
        initialValue: passwordPolicyList.originalPassword
      })( /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.passwordUpdateRate').d('密码更新频率')
      }), getFieldDecorator('passwordUpdateRate', {
        rules: [{
          required: true,
          message: intl.get('cpaas.common.validation.notNull', {
            name: intl.get('ciam.passwordPolicy.model.passwordPolicy.passwordUpdateRate').d('密码更新频率')
          })
        }],
        initialValue: passwordPolicyList.passwordUpdateRate
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: 0,
        precision: 0,
        formatter: function formatter(value) {
          var regex = /\D/g; // 匹配除数字外的所有字符

          var v = _isString(value) ? value.replace(regex, '') : value;
          return "".concat(v, " ").concat(intl.get('ciam.passwordPolicy.model.passwordPolicy.day').d('天'));
        }
      })))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.pwdReminderPeriod').d('密码到期提醒')
      }), getFieldDecorator('passwordReminderPeriod', {
        rules: [{
          required: true,
          message: intl.get('cpaas.common.validation.notNull', {
            name: intl.get('ciam.passwordPolicy.model.passwordPolicy.pwdReminderPeriod').d('密码到期提醒')
          })
        }, {
          validator: this.expireRemindCheck,
          message: intl.get('ciam.passwordPolicy.view.validation.pwdExpiredRemindMsg').d('密码到期提醒天数不能大于密码更新频率天数')
        }],
        initialValue: passwordPolicyList.passwordReminderPeriod
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: 0,
        precision: 0,
        formatter: function formatter(value) {
          var regex = /\D/g; // 匹配除数字外的所有字符

          var v = _isString(value) ? value.replace(regex, '') : value;
          return "".concat(v, " ").concat(intl.get('ciam.passwordPolicy.model.passwordPolicy.dayAgo').d('天前'));
        }
      }))))), /*#__PURE__*/React.createElement(Row, Object.assign({}, EDIT_FORM_ROW_LAYOUT, {
        className: "writable-row"
      }), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.minLength').d('最小密码长度')
      }), getFieldDecorator('minLength', {
        initialValue: passwordPolicyList.minLength,
        rules: [{
          required: true,
          message: intl.get('ciam.passwordPolicy.model.passwordPolicy.minLength').d('最小密码长度')
        }]
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: 6,
        precision: 0,
        max: getFieldValue('maxLength')
      })))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.maxLength').d('最大密码长度')
      }), getFieldDecorator('maxLength', {
        initialValue: passwordPolicyList.maxLength,
        rules: [{
          required: true,
          message: intl.get('ciam.passwordPolicy.model.passwordPolicy.maxLength').d('最大密码长度')
        }]
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: getFieldValue('minLength'),
        precision: 0,
        max: 30
      })))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.digitsCount').d('最少数字数')
      }), getFieldDecorator('digitsCount', {
        initialValue: passwordPolicyList.digitsCount,
        rules: [{
          required: true,
          message: intl.get('cpaas.common.validation.notNull', {
            name: intl.get('ciam.passwordPolicy.model.passwordPolicy.digitsCount').d('最少数字数')
          })
        }]
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: 0,
        precision: 0
      }))))), /*#__PURE__*/React.createElement(Row, Object.assign({}, EDIT_FORM_ROW_LAYOUT, {
        className: "writable-row"
      }), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.lowercaseCount').d('最少小写字母数')
      }), getFieldDecorator('lowercaseCount', {
        initialValue: passwordPolicyList.lowercaseCount,
        rules: [{
          required: true,
          message: intl.get('ciam.passwordPolicy.model.passwordPolicy.lowercaseCount').d('最少小写字母数')
        }]
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: 0,
        precision: 0
      })))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.uppercaseCount').d('最少大写字母数')
      }), getFieldDecorator('uppercaseCount', {
        initialValue: passwordPolicyList.uppercaseCount,
        rules: [{
          required: true,
          message: intl.get('ciam.passwordPolicy.model.passwordPolicy.uppercaseCount').d('最少大写字母数')
        }]
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: 0,
        precision: 0
      })))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.specialCharCount').d('最少特殊字符数')
      }), getFieldDecorator('specialCharCount', {
        initialValue: passwordPolicyList.specialCharCount,
        rules: [{
          required: true,
          message: intl.get('ciam.passwordPolicy.model.passwordPolicy.specialCharCount').d('最少特殊字符数')
        }]
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: 0,
        precision: 0
      }))))), /*#__PURE__*/React.createElement(Row, Object.assign({}, EDIT_FORM_ROW_LAYOUT, {
        className: "writable-row"
      }), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: /*#__PURE__*/React.createElement("span", null, intl.get('ciam.passwordPolicy.model.passwordPolicy.notRecentCount').d('近期密码'), "\xA0", /*#__PURE__*/React.createElement(Tooltip, {
          title: intl.get('ciam.subAccount.view.message.notRecentCount.tooltip').d('近期密码不能作为更新密码')
        }, /*#__PURE__*/React.createElement(Icon, {
          type: "question-circle-o"
        })))
      }), getFieldDecorator('notRecentCount', {
        initialValue: passwordPolicyList.notRecentCount
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: 0
      })))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.notUsername').d('允许与登录名相同')
      }), getFieldDecorator('notUsername', {
        initialValue: passwordPolicyList.notUsername
      })( /*#__PURE__*/React.createElement(Switch, null)))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.forceModifyPassword').d('强制修改初始密码')
      }), getFieldDecorator('forceModifyPassword', {
        initialValue: passwordPolicyList.forceModifyPassword
      })( /*#__PURE__*/React.createElement(Switch, null))))), /*#__PURE__*/React.createElement(Row, Object.assign({}, EDIT_FORM_ROW_LAYOUT, {
        className: "writable-row"
      }), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('cpaas.common.status.enable').d('启用')
      }), getFieldDecorator('enablePassword', {
        initialValue: passwordPolicyList.enablePassword
      })( /*#__PURE__*/React.createElement(Switch, null))))));
    }
    /**
     * 登录安全策略表单
     */

  }, {
    key: "renderLoginForm",
    value: function renderLoginForm() {
      var _this$props4 = this.props,
          _this$props4$form = _this$props4.form,
          getFieldDecorator = _this$props4$form.getFieldDecorator,
          getFieldValue = _this$props4$form.getFieldValue,
          _this$props4$password = _this$props4.passwordPolicy.passwordPolicyList,
          passwordPolicyList = _this$props4$password === void 0 ? {} : _this$props4$password;
      return /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(Row, EDIT_FORM_ROW_LAYOUT, /*#__PURE__*/React.createElement(Row, EDIT_FORM_ROW_LAYOUT, /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.enableCaptcha').d('启用图形验证码')
      }), getFieldDecorator('enableCaptcha', {
        initialValue: passwordPolicyList.enableCaptcha
      })( /*#__PURE__*/React.createElement(Switch, null)))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: /*#__PURE__*/React.createElement("span", null, intl.get('ciam.passwordPolicy.model.passwordPolicy.maxErrorTime').d('最大密码错误次数'), "\xA0", /*#__PURE__*/React.createElement(Tooltip, {
          title: intl.get('ciam.passwordPolicy.view.message.maxErrorTime.tooltip').d('登录时密码错误超过最大密码错误次数将锁定用户')
        }, /*#__PURE__*/React.createElement(Icon, {
          type: "question-circle-o"
        })))
      }), getFieldDecorator('maxErrorTime', {
        initialValue: passwordPolicyList.maxErrorTime
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: getFieldValue('maxCheckCaptcha'),
        precision: 0
      })))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: /*#__PURE__*/React.createElement("span", null, intl.get('ciam.passwordPolicy.model.passwordPolicy.maxCheckCaptcha').d('验证码错误次数'), "\xA0", /*#__PURE__*/React.createElement(Tooltip, {
          title: intl.get('ciam.passwordPolicy.view.message.maxCheckCaptcha.tooltip').d('登录时密码错误超过开启验证码的密码错误次数将显示图像验证码')
        }, /*#__PURE__*/React.createElement(Icon, {
          type: "question-circle-o"
        })))
      }), getFieldDecorator('maxCheckCaptcha', {
        initialValue: passwordPolicyList.maxCheckCaptcha
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: 0,
        max: getFieldValue('maxErrorTime'),
        precision: 0
      }))))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.enableLock').d('允许锁定用户')
      }), getFieldDecorator('enableLock', {
        initialValue: passwordPolicyList.enableLock
      })( /*#__PURE__*/React.createElement(Switch, null)))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: /*#__PURE__*/React.createElement("span", null, intl.get('ciam.passwordPolicy.model.passwordPolicy.lockedExpireTime').d('锁定时长'), "\xA0", /*#__PURE__*/React.createElement(Tooltip, {
          title: intl.get('ciam.passwordPolicy.view.message.lockedExpireTime.tooltip').d('用户锁定时间超过锁定时长将自动解锁')
        }, /*#__PURE__*/React.createElement(Icon, {
          type: "question-circle-o"
        })))
      }), getFieldDecorator('lockedExpireTime', {
        initialValue: passwordPolicyList.lockedExpireTime
      })( /*#__PURE__*/React.createElement(InputNumber, {
        style: {
          width: '100%'
        },
        min: 0,
        precision: 0,
        formatter: function formatter(value) {
          return "".concat(value).concat(intl.get('ciam.passwordPolicy.model.passwordPolicy.second').d('秒'));
        }
      })))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.enableWebLogin').d('PC端允许多处登录')
      }), getFieldDecorator('enableWebMultipleLogin', {
        initialValue: passwordPolicyList.enableWebMultipleLogin
      })( /*#__PURE__*/React.createElement(Switch, null)))), /*#__PURE__*/React.createElement(Col, FORM_COL_3_LAYOUT, /*#__PURE__*/React.createElement(FormItem, Object.assign({}, EDIT_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.passwordPolicy.model.passwordPolicy.enableAppLogin').d('移动端允许多处登录')
      }), getFieldDecorator('enableAppMultipleLogin', {
        initialValue: passwordPolicyList.enableAppMultipleLogin
      })( /*#__PURE__*/React.createElement(Switch, null))))));
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props5 = this.props,
          saving = _this$props5.saving,
          fetchTableListLoading = _this$props5.fetchTableListLoading,
          path = _this$props5.match.path;
      var _this$state$collapseK = this.state.collapseKeys,
          collapseKeys = _this$state$collapseK === void 0 ? [] : _this$state$collapseK;
      return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, {
        title: intl.get('ciam.passwordPolicy.view.message.title').d('安全策略')
      }, /*#__PURE__*/React.createElement(ButtonPermission, {
        permissionList: [{
          code: "".concat(path, ".button.save"),
          type: 'button',
          meaning: '密码策略-保存'
        }],
        type: "primary",
        icon: "save",
        onClick: this.handleSave,
        loading: saving || fetchTableListLoading
      }, intl.get('cpaas.common.button.save').d('保存')), /*#__PURE__*/React.createElement(Button, {
        icon: "sync",
        onClick: this.fetchPasswordPolicyList
      }, intl.get('cpaas.common.button.reload').d('重新加载'))), /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(Spin, {
        spinning: fetchTableListLoading,
        wrapperClassName: classnames(DETAIL_DEFAULT_CLASSNAME)
      }, /*#__PURE__*/React.createElement(Collapse, {
        className: "form-collapse",
        defaultActiveKey: ['passwordPolicy', 'loginPolicy'],
        onChange: this.onCollapseChange
      }, /*#__PURE__*/React.createElement(Panel, {
        showArrow: false,
        header: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", null, intl.get('ciam.passwordPolicy.view.message.subTitle.passwordPolicy').d('密码安全策略')), /*#__PURE__*/React.createElement("a", null, collapseKeys.includes('passwordPolicy') ? intl.get("cpaas.common.button.up").d('收起') : intl.get("cpaas.common.button.expand").d('展开')), /*#__PURE__*/React.createElement(Icon, {
          type: collapseKeys.includes('passwordPolicy') ? 'up' : 'down'
        })),
        key: "passwordPolicy"
      }, this.renderPasswordForm()), /*#__PURE__*/React.createElement(Panel, {
        showArrow: false,
        header: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", null, intl.get('ciam.passwordPolicy.view.message.subTitle.loginPolicy').d('登录安全策略')), /*#__PURE__*/React.createElement("a", null, collapseKeys.includes('loginPolicy') ? intl.get("cpaas.common.button.up").d('收起') : intl.get("cpaas.common.button.expand").d('展开'), /*#__PURE__*/React.createElement(Icon, {
          type: collapseKeys.includes('loginPolicy') ? 'up' : 'down'
        }))),
        key: "loginPolicy"
      }, this.renderLoginForm())))));
    }
  }]);

  return PasswordPolicy;
}(PureComponent), (_applyDecoratedDescriptor(_class2.prototype, "onCollapseChange", [_dec4], Object.getOwnPropertyDescriptor(_class2.prototype, "onCollapseChange"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "fetchPasswordPolicyList", [_dec5], Object.getOwnPropertyDescriptor(_class2.prototype, "fetchPasswordPolicyList"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleSave", [_dec6], Object.getOwnPropertyDescriptor(_class2.prototype, "handleSave"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "expireRemindCheck", [_dec7], Object.getOwnPropertyDescriptor(_class2.prototype, "expireRemindCheck"), _class2.prototype)), _class2)) || _class) || _class) || _class);
export { PasswordPolicy as default };